package com.service.scheduler.job;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;

import com.service.bean.garbage.GetCommntInfo;
import com.service.garbage.ningbo.GarbageAddress;
import com.service.other.Logger;

/**
 * 垃圾称重 查询小区接口 每天零点执行一次
 * @author lj
 *
 */
public class GarbageCommntRefreshJob implements Job {
	
	public GarbageCommntRefreshJob() {}

	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		try {
			JobKey jk = context.getJobDetail().getKey();
			String jobName = jk.getName();
			String jobGroup = jk.getGroup();
			Logger.println("启动任务 [" + jobGroup + "].[" + jobName + "]");
			GetCommntInfo info = new GetCommntInfo();
			String sendMes = info.toString();
			GarbageAddress ga = new GarbageAddress(null, null, null, sendMes);
			ga.getCommntInfo();
			Logger.println("任务执行完毕，下次启动时间：" + context.getNextFireTime());
		} catch (Exception e) {
			Logger.err(e);
		}
	}

}
